#include "request.h"

uint32_t request::PACKET_REQUEST_SIZE = sizeof( uint32_t );

request::request(void) : packet( 0, 0, Request ), type( Invalid )
{}


request::~request(void)
{}

char *request::serialize()
{
	curbuf = buffer_pool->create();

	char *header = packet::serialize();

	memcpy_s( curbuf, PACKET_HEADER_SIZE + PACKET_REQUEST_SIZE, header, PACKET_HEADER_SIZE );

	buffer_pool->destroy( header );

	*(uint32_t *)(curbuf + PACKET_HEADER_SIZE + 1) = htonl( type );

	return curbuf;
}